﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpXML
{
    public class XMLException : Exception
    {
        private XMLElement xEl;
        private string xml;
        public XMLException(XMLElement xEl)
        {
            this.xEl = xEl;
        }

        public XMLException(string xml)
        {
            this.xml = xml;
        }

        public override string Message
        {
            get
            {
                Message.Insert(0, "XML was incorrect. " + xEl != null ? xEl.Name : xml); 
                return base.Message;
            }
        }
    }
}
